<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ page import="java.sql.*,vo.*,dao.*,java.util.ArrayList" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>数据处理页面</title>
</head>
<body>
<jsp:useBean id="tdao" class="dao.TeacherDao"></jsp:useBean>
<jsp:useBean id="tea" class="vo.Teacher"></jsp:useBean>
  <%
   String teano=request.getParameter("teano");
    String teaname=request.getParameter("teaname");
    if(null!=teaname&&!"".equals(teaname))teaname=new String(teaname.getBytes("iso-8859-1"),"utf-8"); 
    String teasex=request.getParameter("teasex");
    
    
    if(null!=teasex&&!"".equals(teasex))teasex=new String(teasex.getBytes("iso-8859-1"),"utf-8"); 
    System.out.print(teasex);
    String title=request.getParameter("title");
    if(null!=title&&!"".equals(title))title=new String(title.getBytes("iso-8859-1"),"utf-8"); 
    tea.setTeano(teano);
    tea.setTeaname(teaname);
    tea.setTeasex(teasex);
    tea.setTitle(title);
    if(null!=teano){
    	tdao.insertOneTeacher(tea);
   }else{
   		response.sendRedirect("stuAdmin.jsp");
   }
   %>   
   <center>
     <h2>添加教师信息</h2>
     <p>
      <br>
       新的数据已经添加到数据库中！
     </p>
    <form action="lookTeacher.jsp" method="post">
       <input type="submit" value="返回">
    </form>
   </center>
</body>
</html>